package com.xilihui.xlh.component.recyclerview;

import android.support.v7.widget.RecyclerView;

/**
 * 2017/2/28.
 */

public abstract class OnBottomListener extends RecyclerView.OnScrollListener {

    protected abstract void onBottom();

    @Override
    public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
        super.onScrollStateChanged(recyclerView, newState);
        if (newState == RecyclerView.SCROLL_STATE_IDLE) {
            if (recyclerView.canScrollVertically(-1)) {
                onBottom();
            }
        }
    }
}
